package com.education.mapper;

import com.education.domain.Tberrorsubject;
import com.education.domain.TberrorsubjectExample;
import com.education.domain.TberrorsubjectWithBLOBs;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface TberrorsubjectMapper {
    @SelectProvider(type=TberrorsubjectSqlProvider.class, method="countByExample")
    int countByExample(TberrorsubjectExample example);

    @DeleteProvider(type=TberrorsubjectSqlProvider.class, method="deleteByExample")
    int deleteByExample(TberrorsubjectExample example);

    @Delete({
        "delete from tberrorsubject",
        "where lId = #{lid,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer lid);

    @Insert({
        "insert into tberrorsubject (lTestId, strErrorType, ",
        "strErrorNum, nErrorRate, ",
        "strErrorUrl, strAnswerUrl, ",
        "strRemark, strErrorTitle, ",
        "strAnswer)",
        "values (#{ltestid,jdbcType=INTEGER}, #{strerrortype,jdbcType=VARCHAR}, ",
        "#{strerrornum,jdbcType=INTEGER}, #{nerrorrate,jdbcType=DOUBLE}, ",
        "#{strerrorurl,jdbcType=VARCHAR}, #{stranswerurl,jdbcType=VARCHAR}, ",
        "#{strremark,jdbcType=VARCHAR}, #{strerrortitle,jdbcType=LONGVARCHAR}, ",
        "#{stranswer,jdbcType=LONGVARCHAR})"
    })
    @Options(useGeneratedKeys=true,keyProperty="lid")
    int insert(TberrorsubjectWithBLOBs record);

    @InsertProvider(type=TberrorsubjectSqlProvider.class, method="insertSelective")
    @Options(useGeneratedKeys=true,keyProperty="lid")
    int insertSelective(TberrorsubjectWithBLOBs record);

    @SelectProvider(type=TberrorsubjectSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="lId", property="lid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="lTestId", property="ltestid", jdbcType=JdbcType.INTEGER),
        @Result(column="strErrorType", property="strerrortype", jdbcType=JdbcType.VARCHAR),
        @Result(column="strErrorNum", property="strerrornum", jdbcType=JdbcType.INTEGER),
        @Result(column="nErrorRate", property="nerrorrate", jdbcType=JdbcType.DOUBLE),
        @Result(column="strErrorUrl", property="strerrorurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="strAnswerUrl", property="stranswerurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="strRemark", property="strremark", jdbcType=JdbcType.VARCHAR),
        @Result(column="strErrorTitle", property="strerrortitle", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="strAnswer", property="stranswer", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<TberrorsubjectWithBLOBs> selectByExampleWithBLOBs(TberrorsubjectExample example);

    @SelectProvider(type=TberrorsubjectSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="lId", property="lid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="lTestId", property="ltestid", jdbcType=JdbcType.INTEGER),
        @Result(column="strErrorType", property="strerrortype", jdbcType=JdbcType.VARCHAR),
        @Result(column="strErrorNum", property="strerrornum", jdbcType=JdbcType.INTEGER),
        @Result(column="nErrorRate", property="nerrorrate", jdbcType=JdbcType.DOUBLE),
        @Result(column="strErrorUrl", property="strerrorurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="strAnswerUrl", property="stranswerurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="strRemark", property="strremark", jdbcType=JdbcType.VARCHAR)
    })
    List<Tberrorsubject> selectByExample(TberrorsubjectExample example);

    @Select({
        "select",
        "lId, lTestId, strErrorType, strErrorNum, nErrorRate, strErrorUrl, strAnswerUrl, ",
        "strRemark, strErrorTitle, strAnswer",
        "from tberrorsubject",
        "where lId = #{lid,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="lId", property="lid", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="lTestId", property="ltestid", jdbcType=JdbcType.INTEGER),
        @Result(column="strErrorType", property="strerrortype", jdbcType=JdbcType.VARCHAR),
        @Result(column="strErrorNum", property="strerrornum", jdbcType=JdbcType.INTEGER),
        @Result(column="nErrorRate", property="nerrorrate", jdbcType=JdbcType.DOUBLE),
        @Result(column="strErrorUrl", property="strerrorurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="strAnswerUrl", property="stranswerurl", jdbcType=JdbcType.VARCHAR),
        @Result(column="strRemark", property="strremark", jdbcType=JdbcType.VARCHAR),
        @Result(column="strErrorTitle", property="strerrortitle", jdbcType=JdbcType.LONGVARCHAR),
        @Result(column="strAnswer", property="stranswer", jdbcType=JdbcType.LONGVARCHAR)
    })
    TberrorsubjectWithBLOBs selectByPrimaryKey(Integer lid);

    @UpdateProvider(type=TberrorsubjectSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") TberrorsubjectWithBLOBs record, @Param("example") TberrorsubjectExample example);

    @UpdateProvider(type=TberrorsubjectSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") TberrorsubjectWithBLOBs record, @Param("example") TberrorsubjectExample example);

    @UpdateProvider(type=TberrorsubjectSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") Tberrorsubject record, @Param("example") TberrorsubjectExample example);

    @UpdateProvider(type=TberrorsubjectSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(TberrorsubjectWithBLOBs record);

    @Update({
        "update tberrorsubject",
        "set lTestId = #{ltestid,jdbcType=INTEGER},",
          "strErrorType = #{strerrortype,jdbcType=VARCHAR},",
          "strErrorNum = #{strerrornum,jdbcType=INTEGER},",
          "nErrorRate = #{nerrorrate,jdbcType=DOUBLE},",
          "strErrorUrl = #{strerrorurl,jdbcType=VARCHAR},",
          "strAnswerUrl = #{stranswerurl,jdbcType=VARCHAR},",
          "strRemark = #{strremark,jdbcType=VARCHAR},",
          "strErrorTitle = #{strerrortitle,jdbcType=LONGVARCHAR},",
          "strAnswer = #{stranswer,jdbcType=LONGVARCHAR}",
        "where lId = #{lid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(TberrorsubjectWithBLOBs record);

    @Update({
        "update tberrorsubject",
        "set lTestId = #{ltestid,jdbcType=INTEGER},",
          "strErrorType = #{strerrortype,jdbcType=VARCHAR},",
          "strErrorNum = #{strerrornum,jdbcType=INTEGER},",
          "nErrorRate = #{nerrorrate,jdbcType=DOUBLE},",
          "strErrorUrl = #{strerrorurl,jdbcType=VARCHAR},",
          "strAnswerUrl = #{stranswerurl,jdbcType=VARCHAR},",
          "strRemark = #{strremark,jdbcType=VARCHAR}",
        "where lId = #{lid,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Tberrorsubject record);
}